]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
mpris: Hide unused elements to leave more space for the title
authorSebastian Keller <skeller@gnome.org>
Thu, 4 Feb 2021 01:17:08 +0000 (02:17 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 4 Feb 2021 22:42:08 +0000 (22:42 +0000)
The Message class this is derived from unconditionally adds a close
button with 0 opacity that only gets shown on hover for messages that
can actually be closed. The MPRIS MediaMessage however can never be
closed and having a close button can cause the title to be cut short
unexpectedly.

Similarly the secondary text which other notifications use to display
the notification time is always left empty here as well.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3664

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1632>

js/ui/mpris.js

index 4e541d8a03dbb54ccc873804580addd5752656bc..b7cc8ea1904265937d4025be2766aaf26824f038 100644 (file)
@@ -28,6 +28,10 @@ class MediaMessage extends MessageList.Message {
         this._icon = new St.Icon({ style_class: 'media-message-cover-icon' });
         this.setIcon(this._icon);
 
+        // reclaim space used by unused elements
+        this._secondaryBin.hide();
+        this._closeButton.hide();
+
         this._prevButton = this.addMediaControl('media-skip-backward-symbolic',
             () => {
                 this._player.previous();